package com.byzx.wine.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.byzx.wine.dao.PurchaseD;
import com.byzx.wine.dao.PurchaseMapper;
import com.byzx.wine.jdbcdao.PurchaseDao;
import com.byzx.wine.po.Purchase;
import com.byzx.wine.service.IPurchaseService;
import com.byzx.wine.util.Page;
@Service
public class PurchaseServiceimpl implements IPurchaseService{
	@Autowired
	private PurchaseMapper  purchasemapper;
	
	@Autowired
	private PurchaseDao  purchaseDao;
	
	@Autowired
	 private PurchaseD pd;
	
	@Override
	public Page<Map<String, Object>> findPage(Page<Map<String, Object>> page) {
		// TODO Auto-generated method stub
		return purchaseDao.findPage("com.byzx.wine.jdbcdao.PurchaseDao.findPurchase", page) ;
	}

	@Override
	public int insert(Purchase purchase) {
		// TODO Auto-generated method stub
		return purchasemapper.insert(purchase);
	}

	@Override
	public Purchase selectByPrimaryKey(Integer id) {
		// TODO Auto-generated method stub
		return purchasemapper.selectByPrimaryKey(id);
	}

	@Override
	public int updateByPrimaryKeySelective(Purchase purchase) {
		// TODO Auto-generated method stub
		return purchasemapper.updateByPrimaryKeySelective(purchase);
	}

	@Override
	public int deleteByPrimaryKey(Integer id) {
		// TODO Auto-generated method stub
		return purchasemapper.deleteByPrimaryKey(id);
	}

	@Override
	public List<Map<String, Object>> findall(Integer wineid) {
		// TODO Auto-generated method stub
		return pd.findall(wineid);
	}

}
